package com.zjapl.web.dao.impl;

import java.io.IOException;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.zjapl.web.action.vo.Log;
import com.zjapl.web.dao.LogDao;

/** 
 * @author 作者:方武斌    E-mail: fangwb@zjapl.com
 * @version 创建时间：2013-1-11 下午3:50:31 
 * 类说明 
 */
public class LogDaoImpl implements LogDao {
	private static SqlMapClient sqlMapClient = null;
	
	// 读取配置文件
		static {
			try {
				Reader reader = Resources.getResourceAsReader("SqlMapConfig.xml");
				sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
				reader.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	
	public boolean logUpload(Log log){
		
		// TODO Auto-generated method stub
		try{
			
			sqlMapClient.insert("LogInsert", log);
			
			}catch(Exception e){
			   e.printStackTrace();
		}
		return true;
	}

}
